const express = require('express');
const app = express();
const port = 8080;
const path=require('path');
//get请求，拦截地址/
app.get('/', (req, res) => {
  res.send('Hello World!');
});

app.post('/', (req, res) => {
  res.sendFile(path.join(__dirname, 'login.html'))
});

app.use(express.static('public'));

//启动服务器，监听端口号
app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
})  